#pragma once

template <typename Key>
struct FibonacciHeap;
namespace FibonacciHeapDetail
{
	template <typename Key>
	struct Node
	{
		using PNodePtr = std::shared_ptr<Node*>;
		using NodeList = std::list<Node*>;
		using NodeListIt = typename NodeList::iterator;

		PNodePtr _ppParent;
		PNodePtr _ppSelf;
		NodeListIt _id;
		NodeList _childen;
		size_t _deg = 0;
		bool _mark = false;

		Key _k;

		Node();
		virtual ~Node();
		auto find(const Key& k)->Node*;
		template <typename Func>
		auto show(std::ostream& os, Func func) const->std::ostream&;
		bool verify(Node* pParent, size_t& num);
	};
}

#include "FibonacciHeapNodeImpl.h"
